In today's sound processors, voice channels are used independently to initiate and control the fetching, interpretation, and processing of sound data which will ultimately be heard through speakers. Any given sound processor has a finite number of voices available.
Different voice channels are used to play different sounds, though not all voice channels are active at the same time. Most voice channels remain idle, and are pre-programmed to turn on (or “keyed on”) when needed in order for the sound that they are responsible for to be played. In many situations one or more voice channels are to be keyed (or “keyed off”) either immediately after another voice channel has completed or partway through that voice channel's processing.
One conventional approach is for the control software to poll status registers in the sound processor to determine the states of the voice channels. When the status registers indicate that a desired condition has been met, such as when a voice channel has completed, the software then instructs the next voice channel to key on. However, this approach requires heavy use of system bandwidth and clock cycles by constantly performing reads to the sound processor and then checking the returned result with a desire value. In addition, there is an inherent latency between the time the desired condition is met, and the time the control software polls the registers, discovers that the desired condition is met, and instructs the next voice channel.
Another convention approach sets up interrupt conditions so that the sound processor can send the central processing unit (CPU) an interrupt when the desired condition is met. The CPU then services the interrupt. However, this approach does not guarantee that the voice channels would be timed properly since interrupts are priority based. Other interrupts may have more importance than the sound processors, and thus latency still exists. In addition, the timing of the events is controlled by the CPU, and thus the programmer is still responsible for controlling the sound processor during operation.
The latency inherent in the convention approaches can result in undesired sound production or forces the programmer to use the sound processor in a different, possibly more time consuming way.
Accordingly, there exists a need for an improved method and apparatus for controlling the voice channels in sound processors. The improved method and apparatus should reduce latency in instructing a voice channel when a desired condition is met and should require fewer CPU resources. The present invention addresses such a need.